package com.sunjq.annotation;

import java.lang.reflect.Field;


public class MyAnnotationRuntimeImpl {
	
	String test = "";

	public String getTest() {
		return test;
	}

	public void setTest(String test) {
		this.test = test;
	}

	public void executeString(final Field field) {
		test = "";
		System.out.println("test1 =>" + test);
		if (field.isAnnotationPresent(MyAnnotationRuntime.class)) {
			 test = field.getAnnotation(MyAnnotationRuntime.class).testString1();
		}
		
		System.out.println("test2 =>" + test);
	}
	
	public static void main (String args[]) {
		MyAnnotationRuntimeExample mare = new MyAnnotationRuntimeExample();
		MyAnnotationRuntimeImpl mari= new MyAnnotationRuntimeImpl();
		Field[] fields = mare.getClass().getDeclaredFields();
		for (Field field : fields) {
			mari.executeString(field);
		}
		System.out.println("test23 =>" + mari.getTest());
	}
}
